#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

    struct stu{
     int grade;
     int name[10];
     int num;
    };
    int main(int argc, char *argv[]) {
    struct stu stud[3];  //定义
    int i, j = 0, k = 0, max, min;
    float avg = 0, sum = 0;
    for (i = 0; i < 3; i++) {  //输入
    scanf("%d", &stud[i].num);
    scanf("%d", &stud[i].name);
    scanf("%d", &stud[i].grade);
    }
    for (i = 0;i < 5; i++) {  //平均值
        sum = sum + stud[i].grade;
    }
    avg = sum / 3.0;
    max = stud[0].grade;  //？
    for (i = 0; i < 3; i++) {
        if(max > stud[i].grade) 
        { max = stud[i].grade;
        j = i;
        }
    }
    for (i = 0; i < 3; i++) {
        if(min < stud[i].grade)  {
            max = stud[i].grade;
            k = i;
        }
    }
    for (i = 0; i < 3; i++) {
        printf("%d", stud[i].grade);
        printf("%d", stud[i].num);
        printf("%d", stud[i].name);
        printf("\n");
    }
    printf("平均数是%f\n", avg);
    printf("最高分是%d",stud[j].num);
    printf("%s", stud[j].grade);
    printf("%d", stud[j].name);
    printf("\n");
    printf("最低分是%d",stud[k].num);
    printf("%s", stud[k].grade);
    printf("%d", stud[k].name);
    printf("\n");
    return 0;
    }
    
    
    
    
    
    
    
